//define(function(require,exports){
	angular.module('shopApp')
		.controller('SuccessCtrl',["$rootScope","$scope","$window","$location","$http", function ($rootScope,$scope,$window,$location,$http) {
			$scope.shopName = $window.localStorage.shopName ? $window.localStorage.shopName : "下单成功";
			$rootScope.pagetitle = $scope.shopName;

			//购物车数据
			$scope.cart =$window.localStorage.cart ? JSON.parse($window.localStorage.cart) : [];
			$scope.qty = $window.localStorage.qty;
			$scope.total = $window.localStorage.total;

			//删除localStorage购物车数据
			$window.localStorage.removeItem("cart");
			$window.localStorage.removeItem("total");
			$window.localStorage.removeItem("shopName");
			$window.localStorage.removeItem("shopId");
			$window.localStorage.removeItem("vipTotal");
			$window.localStorage.removeItem("tocalAmount");

			//scene dish=>点菜成功,booking=>预订成功,scene fee=>缴费成功
			//scence建意取订单返回字段
			$scope.scene = $window.localStorage.scene? $window.localStorage.scene : "dish" ;

			//是否为预订  bookNoDish预订不点菜 bookInDish预订+点菜
			$scope.isBooking = function(){
				if(/\book\i/.test(scene)){
					return true;
				}else{
					return false;
				}
			}
			$http.get(hpfbase.url+"/common/ad-order-success.jhtm")
				.success(function(ret){
					if(ret.statusCode){
						$scope.adList = ret.data;
					}
				});

		}]);
//});
